import React from 'react';
import { HashRouter, Routes, Route, Navigate } from 'react-router-dom';
import Login from './pages/Login';
import Nav from './pages/Nav';
import NotFound from './pages/NotFound';
import { filterAuth } from './utils/global';
import { routes } from './configs/routes';
import Home from './pages/home'
import User from './pages/system/User'
import Role from './pages/system/Role'
import Menu from './pages/system/menu'
import Dict from './pages/system/dict'
import Profile from './pages/Profile';
import Goodstype from './pages/gen/Goodstype';
function App() {
  function renderRoutes(routes) {
    return routes.map(item => {
      return <Route key={item.path} path={item.path} element={item.element} />
    })
  }
  return (
    <HashRouter>
      <Routes>
        <Route path="/" element={<Navigate to="/login" />} />
        <Route path="/login" element={<Login />} />
        <Route path="/nav" element={<Nav />}>
          <Route path="home" element={<Home />}/>
          <Route path="system/user" element={<User />}/>
          <Route path="system/role" element={<Role />}/>
          <Route path="system/menu" element={<Menu />}/>
          <Route path="system/dict" element={<Dict />}/>
          <Route path='profile' element={<Profile/>}/>
          <Route path='gen/goodstype' element={<Goodstype/>}/>
        </Route>
        <Route path="*" element={<NotFound />} />
      </Routes>
    </HashRouter>
  )
}

export default App
